#include "stdafx.h"
#include <serialization/ioParamStructs.h>
#include <serialization/serialization.h>
#include <winsock/winsock_stub.h>

void bind_stub (
    __in  std::vector<char>& in_buf,
    __out std::vector<char>& out_buf
    )
{
//RECEIVE
    Deserialize deserialize (in_buf);
    bind_in_inout bindIN;
    deserialize (bindIN);

    int ret = bind (bindIN.s_, bindIN.addr_, bindIN.addrlen_);
//SEND
    bind_out_inout bindOUT( (ret == 0) ? 0 : WSAGetLastError() );
    
    Serialize(deserialize.get_header(), bindOUT, out_buf);
}
